Skip to content

fix(seo): trailing slash on homepage hreflang/canonical#235

Merged
Mlaz-code merged 1 commit into
mainfrom
fix/hreflang-trailing-slash
May 21, 2026
Merged

fix(seo): trailing slash on homepage hreflang/canonical#235
Mlaz-code merged 1 commit into
mainfrom
fix/hreflang-trailing-slash

Conversation

@Mlaz-code
Copy link
Copy Markdown
Collaborator

Summary

  • Adds trailing slash to canonical and hreflang URLs for locale homepages (/en/, /de/, /es/, /pt-BR/)
  • Fixes 9 Semrush errors: "Conflicting hreflang and rel=canonical" + "No self-referencing hreflang"
  • Deep page URLs unchanged — only homepage (empty mdxPath) affected

Root cause

generateMetadata produced /en (no trailing slash) for canonical/hreflang, but Vercel serves the page at /en/ (with trailing slash). Semrush sees the mismatch as conflicting signals.

Test plan

  • Verify build succeeds
  • curl homepage and confirm canonical has trailing slash
  • Re-run Semrush crawl to confirm 0 hreflang errors

Semrush flagged 9 hreflang conflicts on locale homepages (/en/, /de/,
/es/, /pt-BR/) because canonical and hreflang tags pointed to /en
(no trailing slash) while the page is served at /en/ (with trailing
slash). This caused "Conflicting hreflang and rel=canonical" and
"No self-referencing hreflang" errors.

Fix: append trailing slash to path and subPath when mdxPath is empty
(homepage). Deep page URLs are unchanged.
@Mlaz-code Mlaz-code merged commit 2df01d8 into main May 21, 2026
@Mlaz-code Mlaz-code deleted the fix/hreflang-trailing-slash branch May 21, 2026 18:44
@Mlaz-code
Copy link
Copy Markdown
Collaborator Author

Merge gate (auto-classified): gate=smoke-passed — auto-classified by the gate-log enforcer (5min after merge, no Merge gate: audit comment found). Reviewer agent: please correct if wrong by replying with Merge gate: gate=<correct-word> — <evidence>. The audit log keys on the first such token; your correction overrides this auto-classified guess.

Posted by scripts/gate-log-enforcer.py because instruction-level rules about the gate= template aren't binding (0/N adoption); structural enforcement fills the log either way.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant